#region Using
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
#endregion Using

namespace CY.GFive.Core.Business
{
	public class PurchasingRecord : Business.BusinessBase<PurchasingRecord, int>
	{
		#region Fields and Properties

		private String purchaseCate = String.Empty;
		/// <summary>
		/// 
		/// </summary>
		public String PurchaseCate
		{
			get { return purchaseCate; }
			set
			{
				if (value != purchaseCate)
				{
					MarkChanged("PurchaseCate");
					purchaseCate = value;
				}
			}
		}

		private Decimal totalValue = 0.0m;
		/// <summary>
		/// 
		/// </summary>
		public Decimal TotalValue
		{
			get { return totalValue; }
			set
			{
				if (value != totalValue)
				{
					MarkChanged("TotalValue");
					totalValue = value;
				}
			}
		}

		private String purchaserName = String.Empty;
		/// <summary>
		/// 
		/// </summary>
		public String PurchaserName
		{
			get { return purchaserName; }
			set
			{
				if (value != purchaserName)
				{
					MarkChanged("PurchaserName");
					purchaserName = value;
				}
			}
		}

		private String unit = String.Empty;
		/// <summary>
		/// 
		/// </summary>
		public String Unit
		{
			get { return unit; }
			set
			{
				if (value != unit)
				{
					MarkChanged("Unit");
					unit = value;
				}
			}
		}

		private Decimal price = 0.0m;
		/// <summary>
		/// 
		/// </summary>
		public Decimal Price
		{
			get { return price; }
			set
			{
				if (value != price)
				{
					MarkChanged("Price");
					price = value;
				}
			}
		}

		private int amount = 0;
		/// <summary>
		/// 
		/// </summary>
		public int Amount
		{
			get { return amount; }
			set
			{
				if (value != amount)
				{
					MarkChanged("Amount");
					amount = value;
				}
			}
		}

		private DateTime date = DateTime.MinValue;
		/// <summary>
		/// 
		/// </summary>
		public DateTime Date
		{
			get { return date; }
			set
			{
				if (value != date)
				{
					MarkChanged("Date");
					date = value;
				}
			}
		}

		private Byte state = 0;
		/// <summary>
		/// 
		/// </summary>
		public Byte State
		{
			get { return state; }
			set
			{
				if (value != state)
				{
					MarkChanged("State");
					state = value;
				}
			}
		}

		private String purchasingItem = String.Empty;
		/// <summary>
		/// 
		/// </summary>
		public String PurchasingItem
		{
			get { return purchasingItem; }
			set
			{
				if (value != purchasingItem)
				{
					MarkChanged("PurchasingItem");
					purchasingItem = value;
				}
			}
		}

		#endregion Fields and Properties

		#region Constructors

		public PurchasingRecord()
		{
		}

		#endregion Constructors

		#region Base overrides

		protected override void ValidationRules()
		{
		}

		protected override PurchasingRecord DataSelect(int id)
		{
			return Services.DALService.PurchasingRecordService.Select(id);
		}

		protected override void DataUpdate()
		{
			Services.DALService.PurchasingRecordService.Update(this);
		}

		protected override void DataInsert()
		{
			Services.DALService.PurchasingRecordService.Insert(this);
		}

		protected override void DataDelete()
		{
			Services.DALService.PurchasingRecordService.Delete(this);
		}

		#endregion Base overrides
	}
}
